﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BibliotecaDigital
{
    public partial class fLista : Form
    {
        public IEnumerable<object> itens;
        public String campoIdentidicador;
        public String campoValores;
        public object selectIndex;

        public fLista()
        {
            InitializeComponent();
        }

        private void fLista_Shown(object sender, EventArgs e)
        {
            lbListaItens.DataSource = null;
            lbListaItens.DataSource = itens;
            lbListaItens.ValueMember = campoIdentidicador;
            lbListaItens.DisplayMember = campoValores;
        }

        private void lbListaItens_SelectedIndexChanged(object sender, EventArgs e)
        {
            selectIndex = lbListaItens.SelectedValue;
        }

        private void lbListaItens_DoubleClick(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            Close();
        }
    }
}
